<?xml version="1.0" encoding="utf-8" ?>
<Feature id="BaseFramework" name="Basic Framework configuration regardless of tier">
	<Dependencies>
		<Dependency type="binary">SwafCore.dll</Dependency>
	</Dependencies>
	
	<Macro name="Home">$ConfigParam1$</Macro>
	<Macro name="WebHome">$ConfigParam2$</Macro>
	<Macro name="ParentHome">$Home$</Macro>
	<Macro name="CatalogHome">$ConfigParam1$/configFiles/Catalogs</Macro>
	<Macro name="LogFile">$ConfigParam1$/$ApplicationId$.log</Macro>
	
	<!--  The following 3 macros should be override with application specific values   --> 
	<!--  They are defined here to ensure macro definitions exist   --> 
	<Macro name="ApplicationName"></Macro>
	<Macro name="ApplicationId"></Macro>
	<Macro name="ApplicationDescription"></Macro>
	<!-- Macro that defines the default expiration for session applications -->
	<Macro name="SessionExpire">expire after 15 minutes no use</Macro>
	<Macro name="CatalogDefaultTimeExpire">expire after 15 minutes no use</Macro>
	<ClassFactory id="MacroFunctions">
		<Class name="Cascade" type="Swaf.Resource.CascadeMacro,SwafCore" />
		<Class name="DepthCascade" type="Swaf.Resource.DepthCascadeMacro,SwafCore" />
	</ClassFactory>
	
	<WebRequestHandlers>
		<WebRequestHandler name="res">Swaf.ResWebRequest,SwafCore</WebRequestHandler>
		<WebRequestHandler name="ftp">Swaf.FtpWebRequest,SwafCore</WebRequestHandler>
		<WebRequestHandler name="filecrypto">Swaf.Crypto.FileCryptoWebRequest,SwafCore</WebRequestHandler>
		<WebRequestHandler name="httpcrypto" >Swaf.Crypto.HttpCryptoWebRequest,SwafCore</WebRequestHandler>
	</WebRequestHandlers>	

	<ClassFactory id="Dictionaries">
		<Class type="System.Collections.Hashtable" name="fastAccess"/>
		<Class type="System.Collections.Hashtable" name="macro_versioning"/>
		<Class type="Swaf.Container.FlexiMap,SwafCore" name="messaging_versioning"/>
		<Class type="Swaf.Container.FlexiMap,SwafCore" name="rule_versioning"/>
		<Class type="Swaf.Container.FlexiMap,SwafCore" name="bizobj_versioning"/>
		<Class type="Swaf.Container.FlexiMap,SwafCore" name="versioning"/>
		<Class type="Swaf.Container.FlexiMap,SwafCore" name="fleximap"/>
		<Class type="Swaf.Container.BTreeDictionary,SwafCore" name="ThreadSafe"/>
		<Class type="Swaf.Container.FlexiMap,SwafCore" name="sessiondata"/>
		<Class type="Swaf.Container.FlexiMap,SwafCore" name="appdata"/>
	</ClassFactory>	

	<ClassFactory id="CallTypes">
		<Class type="Swaf.Call.ObjectCall" name="LocalClass" />
		<Class type="Swaf.Call.RuleMgrCall" name="Rule" />
		<Class type="Swaf.Call.DataModelCall" name="DataModel" />
		<Class type="Swaf.Call.SimpleWebServiceRuleMgrCall" name="WebServiceRule" />	
		<Class type="Swaf.Call.RemotingRuleMgrCall" name="RemoteRule" />
		<Class type="Swaf.Call.WebServiceCall" name="WebService" />
		<Class type="Swaf.Call.RoundRobinCall" name="LoadBalance" />
		<Class type="Swaf.Call.BroadcastCall" name="Broadcast" />
		<Class type="Swaf.Call.FailoverCall" name="Failover" />
		<Class type="Swaf.Call.OptionCall" name="Option" />
	</ClassFactory>

	<ApplicationData>
		<Element name="LoggingLevel-Log" type="System.Int32">0</Element>
		<Element name="LoggingLevel-Trace" type="System.Int32">0</Element>
	</ApplicationData>

	<PatternConfig>
		<!-- RawPatterns is a preprocessed version of patterns that is faster to process at startup of an application
		     The difference in performance in is almost negligable on the normal .NET framework, but on the Compact
		     Framework, the difference is very, very noticable. -->
		<!--<Import>RawPatterns.xml</Import>-->
		<Import>Patterns.xml</Import>
	</PatternConfig>
	

	<ClassFactory id="FieldValidators">
		<Class type="Swaf.BizObj.fieldValidator.FloatRangeValidator">
			<Pattern>float{ws}({float}){ws}to{ws}({float})</Pattern>
			<Pattern>float{optional-ws}&lt;={optional-ws}()({float})</Pattern>
			<Pattern>float{optional-ws}&gt;={optional-ws}({float})()</Pattern>
		</Class>
		<Class type="Swaf.BizObj.fieldValidator.LengthValidator">
			<Pattern>length{ws}()({integer}){ws}to{ws}({integer})</Pattern>
			<Pattern>length{optional-ws}(==){optional-ws}({integer})</Pattern>
			<Pattern>length{optional-ws}(&lt;=){optional-ws}({integer})</Pattern>
			<Pattern>length{optional-ws}(&gt;=){optional-ws}({integer})</Pattern>
			<Pattern>not-empty</Pattern>
		</Class>
	</ClassFactory>

	<ClassFactory id="BizObjBizFieldTypes">
		<Class type="System.Object" />
		<Class type="System.String" mutable="false"/>
		<Class type="System.String" name="HumanReadableText" mutable="false"/>
		<Class type="System.Byte" parsable="true"><Default>0</Default></Class>
		<Class type="Swaf.Binary,SwafCore" name="Binary" />
		<Class type="System.Char" parsable="true"/>
		<Class type="System.Collections.ArrayList" name="List" />
		<Class type="Swaf.Container.FlexiMap,SwafCore" name="Map" />
		<Class type="System.Boolean" mutable="false" parsable="true"><Default>False</Default></Class>
		<Class type="System.Int32" name="Integer" mutable="false" parsable="true"><Default>0</Default></Class>
		<Class type="System.Double" mutable="false" parsable="true"><Default>0.0</Default></Class>
		<Class type="Swaf.Container.DecimalFormattingNode,SwafCore" name="Decimal" ><Default>0.0</Default></Class>
		<Class type="Swaf.Container.DecimalFormattingNode,SwafCore" name="Currency"><Default>0.0</Default></Class>
		<Class type="System.Int64" name="BigInteger" mutable="false" parsable="true"><Default>0</Default></Class>
		<Class type="Swaf.Container.DateFormattingNode,SwafCore" name="Date"><Default>0:00</Default></Class>
		<Class type="Swaf.BGuid.Guid,SwafCore" parsable="true"/>
		
		<Class type="Swaf.BizObj.basic.FullBizObjList" factoryMethod="createInstance">
			<Pattern>List{lparen}({word}){rparen}</Pattern>
		</Class>
		<Class type="Swaf.Script.ScriptContainerNode" name="ScriptMethod" mutable="false" />
		
		<Class type="Swaf.BizObj.xml.BizObjExpression" name="BizObjFromXmlNode" />
		<Class type="Swaf.BizObj.xml.DotNetObjExpression" name="NetClassFromXmlNode" />	
		<Class type="Swaf.BizObj.xml.BizObjListExpression" name="BizObjListFromXmlNode" />
	</ClassFactory>
	
	<ClassFactory id="BizObjFieldDecorators">
		<Class name="xmlOut" type="Swaf.GenericDecorator,SwafCore" />
		<Class name="trim" type="Swaf.BizObj.TrimFieldDecorator,SwafCore" />
	</ClassFactory>

  <ClassFactory id="DarDecorators">
    <Class name="security" type="Swaf.DataAccess.DarSecurityDecorator,SwafCore" />
  </ClassFactory>

  <ClassFactory id="GeneralRuleParamTypes">
		<Class type="System.String" mutable="false"/>
		<Class type="System.Collections.ArrayList" name="List" />
		<Class type="System.Boolean" mutable="false" parsable="true"><Default>False</Default></Class>
		<Class type="System.Int32" name="Integer" mutable="false" parsable="true"><Default>0</Default></Class>
		<Class type="System.Double" mutable="false" parsable="true"><Default>0.0</Default></Class>
		<Class type="System.Int64" name="BigInteger" mutable="false" parsable="true"><Default>0</Default></Class>
		<Class type="System.DateTime" name="Date" parsable="true"><Default>0:00</Default></Class>
		<Class type="Swaf.BGuid.Guid,Compact.Swaf" />
		<Class type="Swaf.BizObj.basic.FullBusinessObjectList" name="BizObj List" />
		<Class type="Swaf.BizObj.basic.FullBusinessObject" name="BizObj" />
	</ClassFactory>

	<ClassFactory id="BizObjSources">
		<Class type="Swaf.BizObj.xml.XmlBizSource" name="Xml" />
		<Class type="Swaf.BizObj.basic.FullBusinessObjectSource" name="Basic" />
	</ClassFactory>

	<ClassFactory id="GeneralContainerNodes">
		<Class type="System.String" mutable="false"/>
		<Class type="System.Int32" name="Integer" mutable="false" parsable="true"><Default>0</Default></Class>
		<Class type="Swaf.BizRule.BizObjRules,SwafCore" mutable="true" />
		<Class type="Swaf.Container.ChangeJournalExpireNode" mutable="true">
			<Pattern>expire{ws}(in){ws}({float}){ws}({timetype})(;)expire{ws}on{ws}change{ws}of{ws}({1+ {anychar}})</Pattern>
			<Pattern>expire{ws}(after){ws}({float}){ws}({timetype}){ws}no{ws}use(;)expire{ws}on{ws}change{ws}of{ws}({1+ {anychar}})</Pattern>
			<Pattern>expire{ws}on{ws}change{ws}of{ws}({1+ {anychar}})</Pattern>
		</Class>
		<Class type="Swaf.Container.TimeExpireContainerNode" mutable="true">
			<Pattern>expire{ws}(in){ws}({float}){ws}({timetype})</Pattern>
			<Pattern>expire{ws}(after){ws}({float}){ws}({timetype}){ws}no{ws}use</Pattern>
		</Class>
		<Class type="Swaf.Container.XmlCatalogContainerNode" mutable="true">
			<Pattern>catalog{ws}from{ws}({1+ {anychar}})</Pattern>
			<Pattern>catalog{ws}from{ws}({1+ {anychar}}),{ws}({1+ {anychar}})</Pattern>
		</Class>
		<Class type="Swaf.Container.RuleCatalogContainerNode" mutable="true">
			<Pattern>catalog{ws}using{ws}rule{ws}({1+ {anychar}})</Pattern>
			<Pattern>catalog{ws}using{ws}rule{ws}({1+ {anychar}}),{ws}({1+ {anychar}})</Pattern>
		</Class>
		
	</ClassFactory>	

	<ClassFactory id="DataRequestTypes">
		<Class name="WebDataRequest" type="Swaf.DataAccess.WebServiceRequest,SwafCore" />
	</ClassFactory>
	
	<ClassFactory id="BizRuleDecorators">
		<Class name="callDistance" type="Swaf.GenericDecorator,SwafCore" />
		<Class name="log" type="Swaf.BizRule.LoggingDecorator,SwafCore" />
		<Class name="logLevel" type="Swaf.GenericDecorator,SwafCore" />
		<Class name="logExceptionsOnly" type="Swaf.GenericDecorator,SwafCore" />
		<Class name="security" type="Swaf.GenericDecorator,SwafCore" /><!-- This is set to a generic decorator here so there is no impact to rule execution if security is not being used.-->
		<Class name="trace" type="Swaf.BizRule.TraceDecorator,SwafCore" />
		<Class name="traceLevel" type="Swaf.GenericDecorator,SwafCore" />
		<Class name="traceExceptionsOnly" type="Swaf.GenericDecorator,SwafCore" />
		<Class name="preExtends" type="Swaf.BizRule.BizRuleExtendorDecorator,SwafCore" />
		<Class name="postExtends" type="Swaf.BizRule.BizRuleExtendorDecorator,SwafCore" />
		<Class name="Extensions" type="Swaf.BizRule.BizRuleExtensionDecorator,SwafCore" />
	</ClassFactory>

	<Security>
		<SecurityPrincipal class="Swaf.Security.DefaultSecurityPrincipal,SwafCore"/>
		<DefaultPrincipal userName="CSFDefaultUser"/>
	</Security>
	
	<FieldValidators>
		<Class>Swaf.BizObj.fieldValidator.FloatRangeValidator</Class>
		<Class>Swaf.BizObj.fieldValidator.IntegerRangeValidator</Class>
		<Class>Swaf.BizObj.fieldValidator.LengthValidator</Class>
		<Class>Swaf.BizObj.fieldValidator.OptionalValidator</Class>
		<Class>Swaf.BizObj.fieldValidator.ReadOnlyOn</Class>
		<Class>Swaf.BizObj.fieldValidator.OneOfDList</Class>	
	</FieldValidators>

	<ThreadingConfig>
		<CompositeMonitorClass class="Swaf.BizRule.ThreadedQueue.ThreadedCompositeMonitor,SwafCore" />
		<RuleQueueClass class="Swaf.BizRule.ThreadedQueue.RuleQueue,SwafCore">
			<QueueParams minThreads="1" maxThreads="60" comApartmentType="MTA" minWorkersPerRequest="3" maxWorkersPerRequest="-1" />
		</RuleQueueClass>
		<RuleContextClass class="Swaf.BizRule.ThreadedQueue.WorkerRuleContext,SwafCore"/>
	</ThreadingConfig>

	<ValidatorConfig>
		<PatternValidator
			pattern="pattern({anychar})({lazy 0+ {anychar}}){ditto-memo-1}"
			example="pattern/abc/"
			replace="abc"
			descrip="consistent with the pattern"
		/>
	</ValidatorConfig>
	<BizObjXmlOptions suggestAttributes="true" nullName="NULL" setOnly="false" nullAsElementAttribute="false" />
	<BusinessObjects>
		<!-- This is the base business object for all business objects-->
		<BusinessObject type="BizObj">
			<!-- Added so that UI fields can bind to a valid field they know will be empty.  Used by ASCX type controls that have macros embedded in the specific property and want that over field.-->
			<Field name="sysempty" type="String" />
		</BusinessObject>		
		
		<BusinessObject type="CallInfo" key="id">
			<Field name="id" type="Guid" />
			<Field name="callType" type="String" />
			<Field name="worksWithMultiCall" type="Boolean" />
			<Field name="name" type="String" />
			<Field name="methodName" type="String" />
			<Field name="extraInfo" type="String" />
		</BusinessObject>
		
		<BusinessObject type="BizRule" key="name">
			<Field name="name" type="String" />
			<Field name="callDistance" type="String" />
			<Field name="transaction" type="String" />
			<Field name="call" type="CallInfo" />
		</BusinessObject>
		<BusinessObject type="AuditInfo" key="id">
			<Field name="id" type="Guid"/>
			<Field name="eventId" type="String"/>
			<Field name="time" type="Date"/>
			<Field name="data1" type="String"/>
			<Field name="data2" type="String"/>
		</BusinessObject>
		<BusinessObject extends="CallInfo" type="CompositeCallWorker" key="id">
			<Field name="callDistance" type="String" />
		</BusinessObject>
		<BusinessObject type="IntOptionListOption" key="id">
			<Field name="id" type="Integer" />
			<Field name="name" type="HumanReadableText" />
		</BusinessObject>
	</BusinessObjects>
	<BusinessRules visibility="public">
		<BusinessRule name="getRuleWorkerList">
			<LocalClass name="Swaf.Call.ManagementRules,SwafCore" />
		</BusinessRule>
		<BusinessRule name="addCall">
			<LocalClass name="Swaf.Call.ManagementRules,SwafCore" />
		</BusinessRule>
		<BusinessRule name="addRemoteRuleCall">
			<LocalClass name="Swaf.Call.ManagementRules,SwafCore" />
		</BusinessRule>
		<BusinessRule name="removeCall">
			<LocalClass name="Swaf.Call.ManagementRules,SwafCore" />
		</BusinessRule>
		<BusinessRule name="defineBusinessRule">
			<LocalClass name="Swaf.BizRule.ManagementRules,SwafCore" />
		</BusinessRule>
		<BusinessRule name="removeBusinessRule">
			<LocalClass name="Swaf.BizRule.ManagementRules,SwafCore" />
		</BusinessRule>
		<BusinessRule name="defineBusinessObjects">
			<LocalClass name="Swaf.BizObj.ManagementRules,SwafCore" method="defineBizObjsFromDictionary"/>
		</BusinessRule>
	</BusinessRules>

  <ConfigurationClasses>
    <Class name="sysObjs-CatalogEvents" type="Swaf.Container.CatalogEvents,SwafCore" />
  </ConfigurationClasses>

</Feature>